<?php
/**
 * Created by PhpStorm.
 * User: hp
 * Date: 2019/5/15
 * Time: 8:37
 */
header("Content-Type:application/json;charset=utf-8");
header("Access-Control-Allow-Origin:*");
include "dbhealper.php";

if(isset($_REQUEST["u_id"])){
    $sqlcxbuy="SELECT * FROM `carts` WHERE`c_u_id`='".$_REQUEST["u_id"]."'";
    $result=dbhealper($sqlcxbuy);
    //查询这个人买了什么,如果有多件东西,就有多条信息,所以有个数组;
    $resultArr=array();
    //当$ro!=null,的时候,就把信息放进数组里面;
    while($row=$result->fetch_assoc()){
        array_push($resultArr,$row);
    }

    print_r(json_encode($resultArr));
}else{
    $arr=Array("msg"=>"请先登录","status"=>"-11");
    print_r(json_encode($arr));
}
